package com.team6.stickynote.ui;

import androidx.lifecycle.LiveData;
import androidx.lifecycle.MutableLiveData;
import androidx.lifecycle.ViewModel;

import com.team6.stickynote.App;
import com.team6.stickynote.beans.StickyNoteBean;

import java.util.List;

public class MainViewModel extends ViewModel {

    /**
     * Live Data 便签数据集合
     */
    private final MutableLiveData<List<StickyNoteBean>> _stickyNoteBeans = new MutableLiveData<>();
    LiveData<List<StickyNoteBean>> stickyNoteBeans = _stickyNoteBeans;

    /**
     * 更新 Sticky Note 数据
     */
    public void updateStickyNoteBeans() {
        _stickyNoteBeans.setValue(App.database.queryAllData());
    }

}
